package utils

func CheckFieldExists(data map[string]interface{}, field string) interface{} {
	v, ok := data[field]
	if ok {
		return v
	} else {
		panic("字段[" + field + "]不存在")
	}
}

func GetDefault(data map[string]interface{}, field string, value interface{}) interface{} {
	v, ok := data[field]
	if ok {
		return v
	} else {
		return value
	}
}
